'use strict';
// Copyright 2014 Blueant Inc. All Rights Reserved.

/**
 * @fileoverview 好友
 * @author sundbcn@gmail.com (sun debing)
 */

var friendAccept = require('./friend/accept');
var friendDelete = require('./friend/delete.js');
var friendFight = require('./friend/fight.js');
var friendReceiveAllEnergy = require('./friend/receiveAllEnergy');
var friendReceiveEnergy = require('./friend/receiveEnergy');
var friendRecommend = require('./friend/recommend');
var friendRefuse = require('./friend/refuse');
var friendRefuseAll = require('./friend/refuseAll');
var friendRequest = require('./friend/request');
var friendRequestAll = require('./friend/requestAll');
var friendSendEnergy = require('./friend/sendEnergy');
var friendQueryByName = require('./friend/queryByName');
var friendQueryFriendList = require('./friend/queryFriendList');
var friendQueryRequestFriendList = require('./friend/queryRequestFriendList');

module.exports = function (app) {
    return new Handler(app);
};

var Handler = function (app) {
    this.app = app;
};

/**
 * 同意好友
 */
Handler.prototype.accept = function (msg, session, next) {
    friendAccept(msg, session, next);
};

/**
 * 删除好友
 */
Handler.prototype.delete = function (msg, session, next) {
    friendDelete(msg, session, next);
};

/**
 * 拒绝好友
 */
Handler.prototype.refuse = function (msg, session, next) {
    friendRefuse(msg, session, next);
};

/**
 * 申请好友
 */
Handler.prototype.request = function (msg, session, next) {
    friendRequest(msg, session, next);
};

/**
 * 一键申请
 */
Handler.prototype.requestAll = function (msg, session, next) {
    friendRequestAll(msg, session, next);
};

/**
 * 战斗
 */
Handler.prototype.fight = function (msg, session, next) {
    friendFight(msg, session, next);
};

/**
 * 拒绝好友申请
 */
Handler.prototype.refuse = function (msg, session, next) {
    friendRefuse(msg, session, next);
};

/**
 * 拒绝所有好友申请
 */
Handler.prototype.refuseAll = function (msg, session, next) {
    friendRefuseAll(msg, session, next);
};

/**
 * 推荐好友
 */
Handler.prototype.recommend = function (msg, session, next) {
    friendRecommend(msg, session, next);
};

/**
 * 赠送体力
 */
Handler.prototype.sendEnergy = function (msg, session, next) {
    friendSendEnergy(msg, session, next);
};

/**
 * 接收体力
 */
Handler.prototype.receiveEnergy = function (msg, session, next) {
    friendReceiveEnergy(msg, session, next);
};

/**
 * 接收所有体力
 */
Handler.prototype.receiveAllEnergy = function (msg, session, next) {
    friendReceiveAllEnergy(msg, session, next);
};

/**
 * 查询好友通过名字
 */
Handler.prototype.queryByName = function (msg, session, next) {
    friendQueryByName(msg, session, next);
};

/**
 * 查询申请好友信息
 */
Handler.prototype.queryRequestFriendList = function (msg, session, next) {
    friendQueryRequestFriendList(msg, session, next);
};

/**
 * 查询好友列表
 */
Handler.prototype.queryFriendList = function (msg, session, next) {
    friendQueryFriendList(msg, session, next);
};
